Skip to content

feat(agent-core-v2): add KIMI_CODE_PERMISSION_MODE_REMINDER env to disable auto-mode reminders - #3728

Merged
RealKai42 merged 2 commits into
MoonshotAI:mainfrom
kimi-agent-bot:feat/permission-mode-reminder-env
Sep 11, 2026
Merged

feat(agent-core-v2): add KIMI_CODE_PERMISSION_MODE_REMINDER env to disable auto-mode reminders#3728
RealKai42 merged 2 commits into
MoonshotAI:mainfrom
kimi-agent-bot:feat/permission-mode-reminder-env

Conversation

@kimi-agent-bot

Copy link
Copy Markdown
Collaborator

Why

Entering or leaving auto (AFK) permission mode injects a reminder into the model context ("Auto permission mode is active ... Continue normally without pausing for approval prompts ... make a reasonable decision and continue without asking the user"). The injection is registered unconditionally in AgentPermissionModeService, so unattended evaluation harnesses that run with auto permission mode have no way to keep this "keep going without asking" instruction out of the prompt — it biases agentic-behavior evals (models become noticeably more hyperactive on multi-action tasks).

What

New environment variable KIMI_CODE_PERMISSION_MODE_REMINDER:

  • unset / 1 / true / yes / on — current behavior, unchanged (default);
  • 0 / false / no / off — the permission-mode reminder injection (auto-mode enter + exit reminders) is not registered at all, so nothing mode-related is ever injected into the context.

The gate lives in the AgentPermissionModeService constructor (registration site), so when disabled there is zero overhead and no behavioral difference beyond the missing reminders: mode switching, telemetry, wire records and restore all work exactly as before. Only the context injection is skipped; approval semantics of auto mode itself are untouched.

Tests

  • permissionMode.test.ts: existing reminder tests now run with an explicit bootstrap stub; added two cases — env =0 skips registration (mode ops still work), env =1 keeps registration.
  • agentLifecycle.test.ts: completed the partial bootstrap stub with getEnv (it previously built the service with a stub missing the method).
  • Full agent-core-v2 suite: 6563 passed, 1 skipped. typecheck / oxlint / check-no-comments all green.

…sable auto-mode reminders

The auto (AFK) permission-mode enter/exit reminders are injected into the
model context unconditionally. Unattended evaluation harnesses that run
with auto permission mode have no way to keep that 'keep going without
asking' instruction out of the prompt, which biases agentic-behavior
evals.

Set KIMI_CODE_PERMISSION_MODE_REMINDER=0 (also false/no/off) to skip
registering the permission-mode reminder injection entirely. Default
behavior is unchanged.
@changeset-bot

changeset-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e6ab90e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Sep 11, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@9245556
npx https://pkg.pr.new/@moonshot-ai/kimi-code@9245556

commit: 9245556

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6ab90eb7d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .changeset/permission-mode-reminder-env.md Outdated
Comment thread .changeset/permission-mode-reminder-env.md Outdated
…ts rules

Config additions to an existing feature are a patch bump, and the entry
must be one short user-facing sentence without benefit clauses.
@kimi-agent-bot

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 92455561da

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@RealKai42
RealKai42 merged commit b180725 into MoonshotAI:main Sep 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants